package com.aliyun.messagemgt.web.controller;

import com.aliyun.messagemgt.application.service.OperateLogService;
import com.aliyun.messagemgt.dto.query.OperateLogQuery;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IDEA
 *
 * @author:zhangxingxing 0027012120
 * @date:2019/3/16
 * @time:15:41
 */
@Api(tags = "操作日志相关接口")
@Slf4j
@RestController
public class OperateLogController {

    /**
     * !!! field 根据实际需求，设置最小可见度，不允许
     * !!! 使用接口类型注入，不允许使用接口实际实现注入
     */
    @Autowired
    private OperateLogService operateLogService;

    @RequestMapping("/list/operateLog")
    public Object queryOperateLog(@RequestBody OperateLogQuery operateLogQuery) {
        log.info("操作日志列表，传参operateLogQuery:{}", operateLogQuery.toString());
        return operateLogService.listOperateLog(operateLogQuery);
    }

    @RequestMapping("/operateLog/depVos")
    public Object queryPendingEventListOwnerDept(@RequestBody OperateLogQuery operateLogQuery) {
        return operateLogService.operateLogListOwnerDept(operateLogQuery);
    }

    @RequestMapping("/operateLog/resourceType")
    public Object queryoperateLogListResourceType(@RequestBody OperateLogQuery operateLogQuery) {
        return operateLogService.operateLogListResourceType(operateLogQuery);
    }

}
